]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Complete interrupted size change effects
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 8 Nov 2019 17:22:40 +0000 (18:22 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 8 Nov 2019 17:58:55 +0000 (18:58 +0100)
Resizing effects are more finicky as other effects, as the actual
animation is delayed until we receive the ::size-changed signal.

However that signal may never be emitted if the window is destroyed
just after starting the size-change effect, in which case the effect
is never completed, blocking mutter from destroying the corresponding
window actor.

Address this by tracking when a resize effect is pending, and complete
the effect when appropriate.

https://gitlab.gnome.org/GNOME/mutter/issues/655
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/815

js/ui/windowManager.js

index 74d4faf7fab7d45d140f01c4e5c04ee97f51b69a..c19043faebb40ea27911baa01d828ae44ab13766 100644 (file)
@@ -703,6 +703,7 @@ var WindowManager = class {
         this._unminimizing = new Set();
         this._mapping = new Set();
         this._resizing = new Set();
+        this._resizePending = new Set();
         this._destroying = new Set();
         this._movingWindow = null;
 
@@ -1464,6 +1465,7 @@ var WindowManager = class {
             this._clearAnimationInfo(actor);
         });
 
+        this._resizePending.add(actor);
         actor.__animationInfo = { clone: actorClone,
                                   oldRect: oldFrameRect,
                                   destroyId: destroyId };
@@ -1482,6 +1484,7 @@ var WindowManager = class {
         let scaleX = targetRect.width / sourceRect.width;
         let scaleY = targetRect.height / sourceRect.height;
 
+        this._resizePending.delete(actor);
         this._resizing.add(actor);
 
         // Now scale and fade out the clone
@@ -1538,6 +1541,9 @@ var WindowManager = class {
             actor.translation_y = 0;
             this._clearAnimationInfo(actor);
         }
+
+        if (this._resizePending.delete(actor))
+            this._shellwm.completed_size_change(actor);
     }
 
     _hasAttachedDialogs(window, ignoreWindow) {